IME IM: Be able to handle NULL widget correctly
authorРуслан Ижбулатов <lrn1986@gmail.com>
Tue, 21 May 2019 21:29:38 +0000 (21:29 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 May 2019 20:25:16 +0000 (20:25 +0000)
gtk/gtkimcontextime.c

index 70f54ed1bea723bc257df52714e7910a93ae2676..8b08d7179d927823ddb932573cf08f5ca941976c 100644 (file)
@@ -255,7 +255,10 @@ gtk_im_context_ime_set_client_widget (GtkIMContext *context,
 
   g_return_if_fail (GTK_IS_IM_CONTEXT_IME (context));
   context_ime = GTK_IM_CONTEXT_IME (context);
-  client_surface = gtk_native_get_surface (gtk_widget_get_native (widget));
+
+  client_surface = NULL;
+  if (widget)
+    client_surface = gtk_native_get_surface (gtk_widget_get_native (widget));
 
   if (client_surface)
     {